package com.vader.boot.aware;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * @author Vader
 * @date 2022/5/24
 **/
@Slf4j
public class MyBean implements BeanNameAware, ApplicationContextAware, InitializingBean {
    @Override
    public void setBeanName(String s) {
      log.info("MyBean_setBeanName:{}",s);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        log.info("MyBean_setApplicationContext:{}",applicationContext);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("MyBean_afterPropertiesSet_init");
    }
}
